package com.example.webgobang.service.impl;

import com.example.webgobang.mapper.ChessHistoryMapper;
import com.example.webgobang.model.domin.ChessHistory;
import com.example.webgobang.service.ChessHistoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service
public class ChessHistoryServiceImpl implements ChessHistoryService {
    @Resource
    private ChessHistoryMapper chessHistoryMapper;

    @Override
    public ChessHistory selectHistory(String roomId) {
        ChessHistory chessHistory = null;
        try {
            chessHistory = chessHistoryMapper.selectHistoryByRoomId(roomId);
        } catch (Exception e) {
            log.error(e.getMessage());
        }
        return chessHistory;
    }
}
